package com.oocl.PlantsVsZombies;

public class NormalZombie extends Zombie implements goAhead,Eat{
	public NormalZombie(){
		hitPiont=200;
		attackPiont=100;
		isAlive=true;
		posColumn=0;
		posRow=2;
		speed =1;
	}
	public NormalZombie(int row,int col){
		hitPiont=200;
		attackPiont=100;
		isAlive=true;
		posColumn=col;
		posRow=row;
		speed =1;
	}
	public boolean eat(Plant p) {
		if(p.posRow==this.posRow&&p.posColumn==this.posColumn)
		{
			p.hpCutDown(this.attackPiont);
			return true;
		}
		else return false;
	}
	
	public void goahead(Field f) {
		int i;
		for(i=0;i<speed;i++){
			if(posColumn+i>5){
				System.out.println("僵尸胜利！！！");
				break;
			}
			if(f.hasPlants[posRow][posColumn+i]){
				posColumn+=i;
				break;
			}
			
		}
		
	}
}
